/*
 *  作业1
 */
package com.stage_1.module_4;

public class WorkerTest {

    public static void main(String[] args){
        Worker w = null;
        //空异常
        try {
            w = new Worker("", 18);
        } catch (AgeException e){
            e.printStackTrace();
        } catch (NameException e){
            e.printStackTrace();
        }
        //年龄异常
        try {
            w = new Worker("张三", 16);
        } catch (AgeException e){
            e.printStackTrace();
        } catch (NameException e){
            e.printStackTrace();
        }
        //无异常
        try {
            w = new Worker("张三", 21);
        } catch (AgeException e){
            e.printStackTrace();
        } catch (NameException e){
            e.printStackTrace();
        }

        System.out.println(w.toString());
    }
}
